<template>
	<view class="map-view">
		<map class="map" :scale="scale" :latitude="latitude" :longitude="longitude" :markers="covers" :callout="callout">
		</map>
	</view>
</template>

<script>
var { log } = console; // 解构

export default {
	data() {
		return {
			// 地图map
			latitude: '',
			longitude: '',
			scale: 16,//地图缩放程度
			covers: [
				{
					latitude: '',
					longitude: '',
					iconPath: '../../../static/inster/location.png',
					width: 30,
					height: 30,
					alpha: 0.5,
			
					callout: {
						//自定义标记点上方的气泡窗口 点击有效
						content: '', //文本
						color: '#ffffff', //文字颜色
						fontSize: 14, //文本大小
						borderRadius: 3, //边框圆角
						bgColor: '#00c16f', //背景颜色
						display: 'ALWAYS', //常显
						padding: 2
					}
				}
			],
		};
	},
	methods: {},

	// 接收首页面的路径数据
	onLoad(e) {
		let objdata = JSON.parse(e.obj);
		this.longitude = objdata.longitude;
		this.latitude = objdata.latitude;
		this.residentialName = objdata.residentialName;
		
		this.covers[0].longitude = objdata.longitude;
		this.covers[0].latitude = objdata.latitude;
		this.covers[0].callout.content = objdata.residentialName;
	}
};
</script>

<style scoped>
	.map-view{
		height: 100%;
		width: 100%;
	}
	.map{
		height: 100%;
		width: 100%;
	}
	
	
</style>
